/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2022-03-03
 */
const { success } = require('./utils')

// 附件模块
module.exports = [

  { // 附件配置
    url: '/v1/attachment/config',
    type: 'get',
    response: config => {
      const result = {
        'allowTypeList': '.doc,.gif,.png,.docx,.bmp,.pdf,.xls,.mp4,.3gp,.xlsx,.mov,.txt,.ppt,.wmv,.mp3,.pptx,.rar,.ogg,.zip,.jpg,.jpeg',
        'allowSize': 1.9541984732824427,
        'allowImageTypeList': '.gif,.png,.bmp,.jpg,.jpeg',
        'allowImageSize': '2',
        'allowMediaTypeList': '.mp4,.3gp,.mov,.wmv,.mp3,.ogg',
        'allowMediaSize': '2'
      }
      return success(result)
    }
  },
  // 上传图片
  {
    url: '/v1/attachment/upload-image',
    type: 'post',
    response: config => {
      const result = {
        'items': [
          {
            'id': 16,
            'name': 'default_user.png',
            'ext': 'png',
            'size': 7025,
            'path': '6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
            'url': 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'
          }
        ]
      }
      return success(result, '上传成功')
    }
  },
  // 上传附件
  {
    url: '/v1/attachment/upload',
    type: 'post',
    response: config => {
      const result = {
        'items': [
          {
            'id': 15,
            'name': 'default_user.png',
            'ext': 'png',
            'size': 7025,
            'path': '6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
            'url': 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'
          }
        ]
      }
      return success(result, '上传成功')
    }
  }

]
